#include<iostream>
using namespace std;
using ll = long long;
const int MOD = 1e6 + 3;
ll n, l, r;
int t;
ll qmi(ll a, ll k, ll p)
{
    ll res = 1;
    while (k)
    {
        if (k & 1) res = res * a % p;
        a = a * a % p;
        k >>= 1;
    }
    return res;
}
ll C(ll a, ll b)
{
    ll up = 1, down = 1;
    for (int i = a, j = 1; j <= b; i--, j++)
    {
        up = up * i % MOD;
        down = down * j % MOD;
    }
    return up * qmi(down, MOD - 2, MOD) % MOD;
}
ll Lucas(ll a, ll b, ll p)
{
    if (a < p && b < p) return C(a, b);
    return Lucas(a / p, b / p, p) * C(a % p, b % p) % p;
}
int main()
{
    cin >> t;
    while (t--)
    {
        cin >> n >> l >> r;
        cout << ((Lucas(r - l + n + 1, r - l + 1, MOD) - 1) % MOD + MOD) % MOD << endl;
    }
    return 0;
}